//
//  TuPianVC.swift
//  01-读取二维码
//
//  Created by xmg on 16/5/21.
//  Copyright © 2016年 xiao_kl. All rights reserved.
//

import UIKit

class TuPianVC: UIViewController {

    @IBOutlet weak var imageView: UIImageView!

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        
        let result = QRCoedTool.detectorQRCode(imageView.image!, isAddBounds: true)
        
        if let resultImage = result.resultImage {
            
            imageView.image = resultImage
        }
        
        

        let alertVC = UIAlertController(title: "扫描到的信息", message: result.message.description, preferredStyle: .Alert)
        let action = UIAlertAction(title: "确定", style: .Default, handler: nil)
        alertVC.addAction(action)
        self.presentViewController(alertVC, animated: true, completion: nil)

        
    }
    
    
}
